package com.xbjtech.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xbjtech.mapper.UserMapper;
import com.xbjtech.model.User;
import com.xbjtech.service.UserService;

@Service
public class UserServiceImpl implements UserService {

	@Autowired
	UserMapper userMapper;
	
	@Override
	public User login(String username, String password) {
//		UserExample example = new UserExample();
//		Criteria createCriteria = example.createCriteria();
//		createCriteria.andUsernameEqualTo(username);
//		createCriteria.andPasswordEqualTo(password);
//		List<User> user = userMapper.selectByExample(example);
		return userMapper.selectUserByUsernameAndPassword(username, password);
	}

	@Override
	public User getUserByUsername(String username) {
		return userMapper.selectUserByUsername(username);
	}
	
	

}
